Hall-effect based linear motor controller

ABSTRACT

A linear motion control device for use in a linear control system is presented. The linear motion control device includes a coil driver to drive a coil that, when driven, effects a linear movement by a motion device having a magnet. The linear motion control device also includes a magnetic field sensor to detect a magnetic field associated with the linear movement and an interface to connect an output of the magnetic field sensor and an input of the coil driver to an external controller. The interface includes a feedback loop to relate the magnetic field sensor output signal to the coil driver input.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a divisional of U.S. patent application Ser. No.11/865,118 filed on Oct. 1, 2007, which is incorporated herein byreference.

STATEMENT REGARDING FEDERALLY SPONSORED RESEARCH

Not applicable.

FIELD OF THE INVENTION

This invention relates generally to linear motion control.

BACKGROUND OF THE INVENTION

Closed-loop control in a linear motion control system does not requireadjustments to be made in order to achieve a desired output (or maintaina constant output) despite varying conditions. Typically, closed-loopcontrol is performed by a microcontroller executing firmware thatcompares the system's output signal with a desired command to determinethe drive for the system. Thus, drive input is adjusted until the outputsignal matches the desired command.

In some linear positioning applications, the microcontroller uses outputsignal data from a number of different components, including a positionsensor. For example, in small linear motor applications, a magneticfield sensor such as a Hall-Effect sensor may be used to sense motorposition, which is then used by the microcontroller to supply a drivecurrent to the motor. In linear motion control applications withoutposition sensor feedback, a co-processor (such as digital signalprocessor) may be used to derive the position information, for example,by characterizing linear displacement as a function of drive current.

Closed-loop control of this kind is not without problems, however. Toensure loop stability, it is often necessary to operate the system veryslowly. Such operation results in long response times to changes in themotor's position. Also, precise linear motion control may be difficultto achieve due to hysteresis in the motor's mechanical movement.

SUMMARY OF THE INVENTION

In general, in one aspect, the invention is directed to a linear motioncontrol device (“device”). The device includes a coil driver to drive acoil that, when driven, effects a linear movement by a motion devicehaving a magnet. The device further includes a magnetic field sensor todetect a magnetic field associated with the linear movement and toproduce an output signal in response thereto. Also included is aninterface to connect an output of the magnetic field sensor and an inputof the coil driver to a controller. The interface includes a feedbackloop to relate the magnetic field sensor output signal to the coildriver input.

Embodiments of the invention may include one or more of the followingfeatures. The interface may include a difference amplifier to receive asinputs the magnetic field sensor output signal and an input signalprovided by the controller, and to produce an output signal from suchinputs. The output signal produced by the difference amplifier may bereceived as an input signal at the coil driver input. The magnetic fieldsensor may be a Hall sensor or a magneto-resistive sensor. The coildriver may be connected to the coil to drive current through the coil inone direction or more than one direction. The coil driver may be a voicecoil driver or a linear motor driver implemented with an H-bridgecircuit. The coil driver, magnetic field sensor and interface may beintegrated as a semiconductor integrated circuit.

In another aspect, the invention is directed to a method of focusing alens in a camera module. A displacement range for the lens is determinedand used to request a desired displacement of the lens. The request isprovided to a device that then causes movement of the lens by a voicecoil actuator, by using an internal control loop to adjust a drivecurrent supplied to a coil of the voice coil actuator.

Particular implementations of the invention may provide one or more ofthe following advantages. The internal sensor-to-driver feedback cancompensate for linear motion device (e.g., voice coil actuator, linearmotor, speakers) non-linearities as well as mechanical hysteresis. Incamera lens focusing applications, the determination of the lensdisplacement range in conjunction with the sensor-to-driver feedback cancalibrate the control to a specific lens assembly.

BRIEF DESCRIPTION OF THE DRAWINGS

The foregoing features of the invention, as well as the invention itselfmay be more fully understood from the following detailed description ofthe drawings, in which:

FIG. 1 is a block diagram of an exemplary control system employing alinear motion control device that includes a magnetic field sensor, acoil driver and an interface to provide sensor-to-driver feedback;

FIG. 2 is a schematic diagram of the interface (from FIG. 1);

FIG. 3 is a partial block, partial schematic diagram of the linearmotion control device (from FIG. 1) implemented with a Hall sensor andan H-bridge coil driver for driving an external linear motor;

FIG. 4 is a block diagram of a Hall sensor that may be used in thelinear motion control device of FIG. 3;

FIG. 5 shows an exemplary magnet and coil/magnet assembly;

FIG. 6 shows the positioning of the magnet relative to the coil and thelinear motion control device (implemented as a semiconductor integratedcircuit);

FIG. 7 is a block diagram of an exemplary camera lens focusing system inwhich a linear motion control device such as that shown in FIG. 1 may beutilized;

FIG. 8 is a partial block, partial schematic diagram of the linearmotion control device (from FIG. 1) implemented with a Hall sensor and alow-side driver for driving an external voice coil actuator such as thatshown in FIG. 7;

FIG. 9 is a flow diagram illustrating an exemplary camera lens focusingprocess; and

FIG. 10 shows a plot of Position Input Request versus Output Responseand Actual Movement for the system of FIGS. 7-8.

DETAILED DESCRIPTION

FIG. 1 shows a control system 10 that provides closed-loop linear motioncontrol to a positioning application. The control system 10 includes acontroller 12 connected to a linear motion control device (or “device”)14. The control system 10 also includes a motion device 16, whichincludes a magnet 18 and a coil 20. In the described embodiments, themagnet 18 is movable relative to the coil 20. The control system 10controls the movement of the magnet 18 with the coil 20. The motiondevice 16 may be any type of linear motion device, for example, a linearmotor or linear voice coil actuator. The positioning application may beany application that involves or utilizes linear displacement of such amotion device's magnet.

The linear motion control device 14 includes a magnetic field sensor 22,a coil driver 24 and an interface 26. The magnetic field sensor 22 maybe any magnetic field sensing device, for example, a Hall-effect sensor(Hall sensor) or some kind of magneto-resistive (MR) sensor. The device14 provides to the coil 20 a current signal 28 that is related to anelectrical input signal 30 received from the controller 12. The device14 uses the magnetic field sensor 22 to detect magnetic field strength32 and, based on that detection, returns an electrical signal (shown asoutput signal 34) to the controller 12.

Still referring to FIG. 1, the interface 26 serves to interface themagnetic field sensor 22 to the controller 12 and the coil driver 24 tothe controller 12 via output signal 34 and input signal 30,respectively. The interface 26 also couples the magnetic field sensor 22to the coil driver 24. It receives the output of the magnetic fieldsensor 22 as an input voltage signal 36 and provides an output voltagesignal to the coil driver 24, which the coil driver 24 converts to adrive current (current signal 28) to be applied to the coil 20. Theinterface 26 thus provides a feedback loop from the magnetic fieldsensor 22 to the coil driver 24, as will be described in further detaillater with reference to FIG. 2. The sensor-to-driver feedback of theinterface 26 allows a user to request (via controller 12) a single valueand have the system self stabilize. In other words, the sensor-to-driverfeedback loop allows the system to correct position based on sensorfeedback without intervention by the controller 12 (and/or user), or theneed for other components, such as a linear positioning encoder, toprovide positional feedback information.

Referring to FIG. 2, the interface 26 includes a buffer 40 that passesthe magnetic field sensor output 36 to the controller 12 as outputsignal 34. In addition, the interface 26 includes a first amplifier 44and a second amplifier 46. The first amplifier 44 is a high-gaindifference amplifier that operates as a comparator. It receives asinputs the input signal 30 from the controller 12 and the magnetic fieldsensor output signal 36. It generates an output signal 48 based on thesignals 30 and 36, and that output signal 48 is provided as one of theinput signals to the second amplifier 46. The other amplifier input (forsecond amplifier 46), input signal 50, is coupled to the coil driver 24and connects to ground 52 through a sense resistor 54. The secondamplifier's output signal is shown as a coil driver input 56. Thecomponents 46 and 54 (and associated connections), although shown aspart of the interface 26, could instead be included as part of the coildriver 24. In such a partitioning, the output of the comparator (outputsignal 48) would be an input of the coil driver 24. Also shown in FIG. 2is a supply voltage line 56, which connects the coil driver 24 to anexternal supply voltage (“VDD”). It is the inclusion of the comparator44 as a feedback element that allows an internal (to device 14) closedloop control to be achieved. It will be appreciated that other circuitrymay be included, for example, microcontroller interface, signal shaping,or filtering components, according to the needs of a particular design.

The signal 30 provided by the controller to the interface 26 of device14 may be a pulse width modulation (PWM) input signal or analog, butserial interfaces could also be easily implemented. If a PWM input isused, it will be translated into an analog reference voltage. Referringto FIGS. 1-2, the linear motion control device 14 operates as follows.The feedback circuitry of the interface 26 drives current through thecoil 20. The current in the coil 20 changes until the position of themotion device 16 results in a magnetic field sensor output voltage(output 36) that has a predetermined relationship with respect to theinput 30, such as matching the input 30 (or the PWM converted internalanalog signal, if a PWM input is used, or serial reference).

Referring to FIG. 3, an exemplary embodiment of the device 14 that isparticularly well-suited to linear motor drive and control is shown asdevice 60. The types of linear motors that might be controlled/driven bysuch a device include small linear motors such as vibration motors,shutter triggers, polarization filters, speaker control, to give but afew examples. In this embodiment, the magnetic field sensor 22 and thecoil driver 24 (from FIG. 1) are implemented as a Hall-Effect sensor (orHall sensor) 62 and an H-bridge driver 64, respectively. An H-bridgedriver provides for bidirectional current flow, thus enabling the linearmotor to run in a forward and reverse direction. Drive current output 28(from FIG. 1) is shown here to include a first output 28 a whichconnects to one end of an external coil (coil 20 from FIG. 1) and asecond output 28 b which connects to the other end of the external coil.In the illustrated embodiment, the H-bridge is constructed with foursolid-state switches (labeled S1, S2, S3, S4, in the figure). When S1and S4 are closed (and S2 and S3 are open) current flows through thecoil 20 in one direction. Opening S1 and S4 and closing S2 and S3 causescurrent to flow through the coil 20 in the reverse direction.

FIG. 4 shows one simplified example of a Hall sensor that can be usedfor the Hall sensor 62 (from FIG. 3). Other Hall sensor designs could beused as well. The Hall sensor 62 includes a Hall element 70 as well asvarious signal conditioning components, for example, a dynamic offsetcancellation circuit 72 (that uses chopper stabilization), an amplifier74, a sample and hold (and averaging) circuit 76 and a low pass filter78. A clock circuit 80 provides timing signals to the dynamic offsetcancellation circuit 72, amplifier 74 and sample and hold (andaveraging) circuit 76, as indicated. In speaker applications, whereabsolute offset is less important than in other types of applications, anon-chopped element may be useful from a bandwidth perspective.

In one exemplary embodiment, as shown in FIGS. 5-6, the linear motioncontrol device 14 is implemented as a semiconductor integrated circuit(IC). That is, the magnetic field sensor is integrated with thecircuitry of the coil driver and interface on a single semiconductorsubstrate. Therefore, the device 14 may be manufactured and sold as anIC for use in a module design.

FIGS. 5-6 show an exemplary magnet and device/coil assembly 90. In themechanical system shown in FIGS. 5-6, the magnet 18 moves relative to astationary coil. The assembly 90 is part of a motor (not shown in itsentirety), which would be connected to a device or structure to be movedfor a given application. Thus, FIGS. 5 and 6 depict an implementation inwhich the integrated device 60 is mounted or embedded in a motor.Referring to FIGS. 5 and 6, the integrated device 60 (that includes theHall element 70) is connected to the coil 20 (shown as drive coil 20)and the coil 20 is mounted to a biasing plate 92 in a device/coilstructure 94. The magnet 18 is suspended above the device/coil structure94 by a mechanical suspension system (not shown) that allows the magnet18 to move along the desired path of motion (indicated by arrow 96). Themagnet 18 shown in the figure is configured as a pair of magnets withopposite orientation. That is, the south magnetic pole of one magnet andnorth magnetic pole of the other magnet (in the magnet pair) each facethe Hall element 70. The magnet 18 moves in a horizontal plane above thesensing face of the Hall element 70 in what is referred to as a “bipolarslide-by” mode of operation. Other magnet configurations and modes maybe used. The illustrated configuration/mode allows improved sensingprecision for smaller magnet travel.

Referring to FIG. 6, in the absence of a current in the coil 20, thebiasing plate 92 causes the magnet 18 to be centered over thecoil/device structure 94 (“center position”, indicated by referencenumeral 98 a). When a current is applied by the coil driver to the coil20, the flux generated by the energized coil 20 interacts with fluxgenerated by the magnet 18. This interaction causes the magnet 18 toreact with a force either in one direction or the opposite directiondepending on the polarity of the coil flux. That is, the appropriatepoles of the magnet 18 are either attracted or repelled to produce theforce. The stronger the current is the stronger the resulting force is.In the illustration of FIG. 6, an application of a positive 100 mA drivecurrent to the coil 20 results in the magnet 18 moving to the leftposition (“left position”, indicated by reference numeral 98 b) and anapplication of a negative 100 mA drive current to the coil 20 (i.e., adrive current of 100 mA flowing in the opposite direction through thecoil) results in the magnet 18 moving to the right position (“rightposition”, indicated by reference numeral 98 c). Therefore, in theembodiment of FIGS. 3-6, the device 60 operates over both magnetic polesof the magnet 18 as well as drives the current in both directionsthrough the coil 20 to effect the magnet movement depicted in FIGS. 5-6.

The device 14 (FIG. 1), with the feedback mechanism of interface 26, asdescribed above, may be used in a variety of other applications, such asapplications that use voice coil actuators. One example, as shown inFIG. 7, is a camera lens focusing module (or “module”) 100 as may beused in a mobile phone with camera, also known as a camera phone.Traditionally, digital still cameras used stepper motors as actuators.Because of their size, complexity and power requirements, stepper motorsare not well-suited for camera modules in camera phones. One actuatoroption for phone cameras is the voice coil actuator. Voice coilactuators are useful as drivers in limited motion, high frequencyactivation applications, such as that of the lens driving device ofmodule 100, as well as other precision instrument applications.

The module 100 includes a controller 102 that executes a lens focusingprocess 104 and provides control signals to other blocks of the module.The controller 102 may control overall operation of the camera phone andthus switch between telephone and camera functions, or the controller102 may be dedicated to a camera mode of operation (with a separatecontroller for handling the telephone mode). The controller 102 isconnected to the device 14, which drives a voice coil actuator 106. Asindicated earlier with reference to the linear motor control applicationshown in FIGS. 3-6, the device 14 may be constructed as a semiconductorintegrated circuit with voice coil driver and magnetic field sensorintegrated on a single substrate. Also, the magnet and device/coilassembly may be similar to that described above with reference to FIGS.5-6, but with a different coil and coil driver for unidirectional drive.Alternatively, a magnet with a simple spring biasing mechanism could beused.

The voice coil actuator 106 controls the linear movement of a lens 108of an optical assembly 110 to adjust the lens focus. The coil driver 24of the device 14 controls the voice coil actuator 106. The module 100also includes an image sensor 112, a signal processor (SP) 114 and aframe memory 116. The operation of this module will now be described.

Assuming that the controller 102 has switched to a camera function or isin a camera mode, the image sensor 112 is activated, and the controller102 sends a control signal (timing signal) via control lines 118 to theimage sensor 112 to start an image capturing process. An image projectedby the lens 108 onto the image sensor 112 is scanned and applied to theSP 114. The controller 102 activates the signal processor 114 to beginauto focus processing. The SP 114 performs sampling, amplification andA/D conversion to an image signal output from the image sensor 112 andoutputs the digital image data. The frame memory 116 temporarily storesthe digital image data sequentially output from the SP 114. The SP 114determines a contrast value of the image according to the image datastored in the frame memory 116. Every time the image is captured by theimage sensor 112 and that image is stored in the frame memory 116, theSP 114 reads the image data and calculates the contrast value.

The controller 102 outputs a control signal 30 to the linear motioncontrol device 14 to begin focus adjustment. The driver portion of thedevice 14 generates the drive signal 28 according to the input signal 30from the controller and the feedback signal 36 from the magnetic fieldsensor 22. The lens position adjustment by the voice coil actuator 106results in change in image sharpness. The SP 114 determines contrastvalue of the image data sequentially captured by the image sensor 112and compares values between images captured before and after lensmovement. The SP 114 detects that the image with best sharpness isobtained when the contrast value that is a peak value is detected andsends a detection signal to the controller 102. The controller 102 sendsthe appropriate control signal (to the device 14) to move the lens 108back to the position where the peak contrast value was obtained, thatis, the precise position to achieve best sharpness to complete the focusadjustment. Although the SP 114 is described as determining a contrastvalue, other parameters indicative of optimum focal position may becomputed by the SP 114.

The signal 30 provided by the controller to the interface 26 of device14 may be a PWM input signal. If a PWM input is used, it will betranslated into an analog voltage. As was described earlier, thefeedback circuitry of the interface 26 is used to drive current throughan external voice coil. The current in the coil changes until theposition of the lens assembly results in a Hall sensor output voltagethat has a predetermined relationship with respect to the input, forexample, matches the input (or the PWM converted internal analog signalif a PWM input is used). The Hall sensor output is also available to thecontroller 102 via the output 34 of the interface 26. In one embodiment,as will be described with reference to FIG. 9, the controller 102 usesthis output voltage to implement a focus control scheme via the PWMinput. Such focus control can take advantage of the closed loop controlof the feedback loop to eliminate mechanical hysteresis and linearizeactuator transfer function non-linearities in the camera focus module.

Referring to FIG. 8, an exemplary embodiment of the device 14 that canbe used to drive the voice coil actuator 106 (from FIG. 7) is shown asdevice 120. In this embodiment, the magnetic field sensor 22 and thecoil driver 24 (from FIGS. 1 and 7) are implemented as a Hall sensor 62and a low-side, voice coil driver 122, respectively. The voice coildriver 122 shown in the figure includes a MOSFET 126 (in addition tocomponents 46 and 54) as output driver. The voice coil driver 122provides for unidirectional current flow only. The voice coil drivercurrent output, shown as output 28 b, connects to the low side of anexternal coil (coil 20 from FIG. 1).

The device 120 also includes a user-controlled Sleep input 124 thatreduces the current consumption when the device 120 is in sleep mode.End users can control the current consumption of the device 120 byapplying a logic level signal to the Sleep input. This low power featuremakes the device ideal for battery-operated applications such ascellular phones and digital cameras.

Manufacturing tolerances, as well as lens orientation (relative to thedirection of gravitational pull and applied loads like acceleration,etc.), do not allow for consistent lens movement in response to currentapplied to the coil. The lens focusing process 104 employed by thecontroller 102 (FIG. 7) not only removes mechanical hysteresis (throughthe use of the sensor-to-driver feedback), but also allows the controlsystem to be precisely calibrated to a specific lens focus module, aswill be described with reference to FIG. 9.

Referring to FIG. 9, the lens focusing process (“process”) 104 performedby the controller 102 is shown. Once the process is initiated (block130), it reads an output value of the device (that is, the outputgenerated by the Hall sensor in whatever form it is presented to thecontroller) when no current is applied to the coil (0 current drive) andstores that value as a first value, “0IV” (block 132). The process 104then sends a request, at the input 30, to provide a current to the coilto effect a maximum displacement (or “travel”) of the lens (Max currentdrive) (block 134). The process 104 again reads the output value (fromthe Hall sensor) corresponding to the maximum lens travel and storesthat value as a second value, “MIV” (block 136). The process 104 usesthe first and second values to determine a travel value corresponding totravel per frame in duty cycle, more specifically, it determines thedifference between the values (that is, MIV−0IV) and divides thatdifference value by number of frames (block 138). Dividing the lenstravel range by the desired number of frames defines a fixed step sizefor movement. The per-frame value is saved as a third value, “T”. Thus,by measuring a baseline magnetic field with no current applied to thecoil and then again at a maximum travel/displacement, the process 104 isable to determine a travel range for the lens. The processing actions ofthe process 104 thus far, those represented by blocks 132, 134, 136 and138, can be viewed as a calibration process. The calibration processcalibrates the linear motion control to the individual lens focus modulefor precision focusing independent of manufacturing variations of theassembly. The calibration mode thus advantageously reduces focus timesduring an autofocus application.

Still referring to FIG. 9, once the travel range has been determined,the process 104 requests a desired travel (value “D”) at the input ofdevice 14 (block 140). The value “D” is determined by multiplying avalue “0IV+T” by “frame#”, where “frame#” corresponds to a current framenumber. The user can request any value between the two extremes and thesystem will self adjust to that position based on the feedback in thesystem. The process 104 causes an image to be captured (block 142) for acurrent frame. The process 104 determines if the current frame is themaximum frame (block 144). If it is determined that the current frame isnot the maximum frame, the process 104 advances to a next frame (byincrementing frame#) (block 146) and returns to block 140 to request anew desired travel, corresponding to a new lens position. If the currentframe is the maximum frame, the process 104 causes the selection of the“best” frame (that is, the frame that has the best sharpness, asdetermined by the SP 114) as being in focus and movement to that frame(block 148). Moving to the selected frame involves moving the lens tothe appropriate position and thus requesting a “D” input to device 14for the selected frame (and frame number). The process 104 enables apicture (at full resolution) to be taken for the selected “best” frame(block 150), causes movement of the lens to home position (block 152)and terminates at block 154. If a sleep mode (via a sleep input, asdescribed earlier with reference to FIG. 8) is available, it may bedisabled at block 130 and then enabled at block 154.

In digital camera applications such as the one described with referenceto FIGS. 7-9, the closed loop control circuitry of the linear motioncontrol device 14 simplifies the lens focusing process. It providesprecision movements of a lens (independent of magnetic variation due tohysteresis in the lens travel) with fewer focusing steps. Consequently,the module 100 can be operated for shorter periods of time, whichreduces power consumption in a camera system. It also allows exactre-creation of a previous focus position.

FIG. 10 illustrates the relationship between the position input request(labeled “PWM”, in Volts), the output response (labeled “FBout”, inVolts) and actual movement in terms of position change (labeled “Deltaposition”, in um) during active range. The active range is based on aninitial position of 0 um (the equivalent of ‘0 Gauss’) and a completeposition change at 220 um. As can be seen in the figure, the use of thelinear motion control device with internal feedback serves to produce ahighly linear response.

All references cited herein are hereby incorporated herein by referencein their entirety.

Having described preferred embodiments of the invention, it will nowbecome apparent to one of ordinary skill in the art that otherembodiments incorporating their concepts may be used. It is felttherefore that these embodiments should not be limited to disclosedembodiments, but rather should be limited only by the spirit and scopeof the appended claims.

What is claimed is:
 1. A method of focusing a lens in a camera modulehaving a voice coil actuator to effect displacement of the lens,comprising: determining a displacement range value for the lens;determining a per-frame value based on the displacement range value forthe lens and a desired number of frames; using the per-frame value and acurrent frame number to determine a value corresponding to a desireddisplacement of the lens; and providing a request comprising the valuecorresponding to the desired displacement of the lens as an input to adevice that adjusts a drive current supplied to a coil of the voice coilactuator according to the value corresponding to the desireddisplacement of the lens and an internal feedback loop in the deviceuntil the desired displacement of the lens has been effected by thevoice coil actuator.
 2. The method of claim 1, further comprising:causing capture of an image projected by the lens in a frame;determining if the frame is a maximum frame; and if the frame isdetermined not to be a maximum frame, incrementing the current framenumber and returning to the step of using the per-frame value and thecurrent frame number to determine a value corresponding to a desireddisplacement of the lens.
 3. The method of claim 2, further comprising:if the frame is determined to be the maximum frame, determining whichframe is in focus; selecting the frame that is determined to be infocus; causing the lens to be moved to a position for the selectedframe; and causing a picture to be taken for the selected frame.
 4. Themethod of claim 3, wherein causing the lens to be moved to a positionfor the selected frame comprises: providing a request to the device thatcauses the device to adjust the drive current supplied to the coilaccording to the request and the internal feedback loop in the deviceuntil the lens has been moved to the position for the selected frame. 5.The method of claim 1, wherein determining the displacement range valuecomprises: obtaining a value corresponding to a position of the lenswhen no current is supplied to the coil; obtaining a second valuecorresponding to a second position of the lens when a maximum drivecurrent is supplied to the coil, wherein obtaining the second valuecomprises providing a maximum current drive request to the device thatcauses the maximum drive current to be supplied to the coil; anddetermining a difference between the first value and the second value.6. A method of focusing a lens in a camera module having a voice coilactuator to effect displacement of the lens, comprising: determining adisplacement range value for the lens by obtaining a value correspondingto a position of the lens when no current is supplied to a coil of thevoice coil actuator, Obtaining a second value corresponding to a secondposition of the lens when a maximum drive current is supplied to thecoil, wherein obtaining the second value comprises providing a maximumcurrent drive request to a device that causes the maximum drive currentto be supplied to the coil, and determining a difference between thefirst value and the second value; determining a value corresponding to adesired displacement of the lens based on the displacement range value;providing a request comprising the value corresponding to a desireddisplacement of the lens based on the displacement range value to thedevice, causing the device to adjust a drive current supplied to thecoil according to the value and an internal feedback loop in the deviceuntil the desired displacement of the lens has been effected by thevoice coil actuator.
 7. A method of focusing a lens in a camera module,comprising: determining a displacement range for the lens; using thedisplacement range to request a desired displacement of the lens; andproviding the request to a device that causes displacement of the lensby a voice coil actuator, by using an internal control loop comprising amagnetic field sensor to adjust a drive current supplied to a coil ofthe voice coil actuator.